//
//  DWLogViewController.m
//  OCAPPDemo
//
//  Created by OS on 2022/1/6.
//

#import "DWLogViewController.h"
#import "DWLogListViewController.h"
#import "FCFileManager.h"
#import "DWLogManager.h"

@interface DWLogViewController ()

@property (weak, nonatomic) IBOutlet UITextView *textView;

@end

@implementation DWLogViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    NSString *homePath1 = NSHomeDirectory();
    
    self.textView.text = homePath1;
    
}

- (IBAction)writeLog:(id)sender {
    
    [DWLogManager logVerbose:@"Hello world!"];
    
}

- (IBAction)crash:(id)sender {
    
    NSMutableArray *arr = [NSArray new];
    [arr addObject:@1];
}

- (IBAction)crash1:(id)sender {
    
    [FCFileManager removeItemsInDirectoryAtPath:[DWLogManager getLogPath]];
    
}


- (IBAction)crash2:(id)sender {
    
}

- (IBAction)showCrash:(id)sender {
    
    DWLogListViewController *vc = [[DWLogListViewController alloc] init];
    vc.title = @"crash";
    vc.filePath = [DWLogManager getCrashPath];
    [self.navigationController pushViewController:vc animated:YES];
    
}

- (IBAction)showNetwork:(id)sender {
    DWLogListViewController *vc = [[DWLogListViewController alloc] init];
    vc.title = @"Log";
    vc.filePath = [DWLogManager getLogPath];
    [self.navigationController pushViewController:vc animated:YES];
}

@end
